package chatRoom.com.fenwe.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;

import chatRoom.com.fenwe.dao.CompanyDOMapper;
import chatRoom.com.fenwe.dao.entity.CompanyDO;
import chatRoom.com.fenwe.dao.entity.CompanyDOExample;
import chatRoom.com.fenwe.dao.entity.CompanyDOExample.Criteria;
import chatRoom.com.fenwe.service.ICompanyService;

@Service
public class CompanyServiceImpl implements ICompanyService {
    @Autowired
    private CompanyDOMapper CompanyDAO;

    public List<CompanyDO> queryCompany() throws Exception {
        CompanyDOExample companyDOExample = new CompanyDOExample();
        companyDOExample.setDistinct(true);
        Criteria criteria = companyDOExample.createCriteria();
        criteria.andCnameEqualTo("咪咕音乐有限公司");
        // Criteria criteria2 = companyDOExample.createCriteria();
        // criteria2.andCnameEqualTo("卓望数码科技");
        // criteria.addCriterion(String.format("(cflag=%d or cflag=%d)", 1, 0));
        List<CompanyDO> companyDOs = CompanyDAO.selectByExample(companyDOExample);
        return companyDOs;
    }

}
